import store from '@/store'


const scale = {};


scale.auto = (size,minSize) => {
    if(!minSize){
        minSize = 12;
    }
    let s = Math.max((3240/19200),store.state.scale)
    return Math.max(s*size,minSize);
}
scale.transform = (size) => {
    let s = store.state.scale;
    let ns = s*size;
    if(ns<12){
        return ns/12;
    }
    return 1;
}
scale.webkitTransform = (ss) => {
    let size = ss+3;
    let s = store.state.scale;
    let ns = s*size;
    var val = 1;
    if(ns<12){
        val = ns/12;
    }
    return {
        // 'font-size':size+'px',
        '-webkit-transform-origin-x': 0,
        '-webkit-transform':'scale('+val+')',
        '-moz-transform':'scale('+size/ss+')',
    }
}
export default scale